package com.facebook.app.client.view;

import com.facebook.app.client.presenter.ClusterStrategyChosenPresenter;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.widgetideas.client.ProgressBar;

public class ClusterStrategyChosenView extends Composite implements ClusterStrategyChosenPresenter.Display {
	
	private final VerticalPanel statusPanel = new VerticalPanel();
	private final Label statusLabel = new Label();
	private final ProgressBar progressBar = new ProgressBar();
	private final Image loadingImage = new Image("http://www.crewcheck.org/images/loading.gif");
	
	public ClusterStrategyChosenView() {
		initWidget(statusPanel);
		statusPanel.setSpacing(4);
		
		statusPanel.add(statusLabel);
		statusPanel.setCellHorizontalAlignment(statusLabel, HasHorizontalAlignment.ALIGN_CENTER);
//		progressBar.setVisible(false);
		statusPanel.add(progressBar);
		
		loadingImage.setVisible(false);
		statusPanel.add(loadingImage);
		statusPanel.setCellHorizontalAlignment(loadingImage, HasHorizontalAlignment.ALIGN_CENTER);
	}
	
	@Override
	public Panel getStatusPanel() {
		return statusPanel;
	}
	
	@Override
	public Label getStatusLabel() {
		return statusLabel;
	}
	
	@Override
	public ProgressBar getProgressBar() {
		return progressBar;
	}
	
	@Override
	public Image getLoadingImage() {
		return loadingImage;
	}
	
	@Override
	public Widget asWidget() {
		return this;
	}

}
